package com.javalab._6feature._2generic;

/**
 * 泛型类
 */
public class GenericClass<T> {
    private T t;

    public GenericClass(T t) {
        this.t = t;
    }

    public T getT() {
        return t;
    }

    public void setT(T t) {
        this.t = t;
    }

    public static void main(String[] args) {
        GenericClass<Integer> g1 = new GenericClass<>(Integer.valueOf("1"));
        System.out.println(g1.getT());

        GenericClass<String> g2 = new GenericClass<>("hello");
        System.out.println(g2.getT());
    }
}
